<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/loggedTemplate.xhtml">

	<f:metadata>
		<f:event type="preRenderView"
			listener="#{cidadeBean.initConversation}" />
	</f:metadata>

	<ui:define name="content">
		<h1 class="formTitle ui-widget-header ui-corner-all">#{msg['cidade.titulo.cadastro']}</h1>

		<h:form id="cidadeForm">
		
			<p:growl id="messages" />	
		
			<p:panelGrid columns="2" id="panel">
			
				#{msg['cidade.uf']}
				<p:selectOneMenu value="#{cidadeBean.entidade.uf}" id="uf" height="120"
					converter="viewMapEntityConverter" panelStyle="width:150px" effect="fade" var="sUf"
					style="width:160px" filter="true" filterMatchMode="startsWith">
					<f:selectItems value="#{cidadeBean.ufs}" var="uf" itemLabel="#{uf.nome}" itemValue="#{uf}" />
					<p:column>  
                		#{sUf.nome}  
            		</p:column>
            		
				</p:selectOneMenu>
				
				#{msg['cidade.nome']}
				<p:inputText value="#{cidadeBean.entidade.nome}" id="nome" label="#{msg['cidade.nome']}" />

			</p:panelGrid>
			
			<div id="buttons" class="ui-widget ui-widget-header">
				<p:commandButton value="#{msg['botao.salvar']}"
					action="#{cidadeBean.salvar}" update="cidadeForm" ajax="false" />
				<p:commandButton value="#{msg['botao.cancelar']}"
					action="#{cidadeBean.cancelar}" immediate="true" />
			</div>
			
		</h:form>
	</ui:define>
	
	
</ui:composition>
